package com.angel.service.ServiceImpl;

import com.angel.bean.dto.GoodListDto;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.angel.bean.GoodsList;
import com.angel.mapper.GoodsListDao;
import com.angel.service.GoodsListService;

@Service
public class GoodsListServiceImpl implements GoodsListService{

    @Resource
    private GoodsListDao goodsListDao;

    @Override
    public int insert(GoodsList goodsList){
        return goodsListDao.insert(goodsList);
    }

    @Override
    public int insertSelective(GoodsList goodsList){
        return goodsListDao.insertSelective(goodsList);
    }

    @Override
    public int insertList(List<GoodsList> goodsLists){
        return goodsListDao.insertList(goodsLists);
    }

    @Override
    public int update(GoodsList goodsList){
        return goodsListDao.update(goodsList);
    }

    @Override
    public int delete(GoodsList goodsList){
        return goodsListDao.delete(goodsList);
    }

    @Override
    public GoodsList findOne(GoodsList goodsList) {
        List<GoodsList> list =this.findGoodsList(goodsList);
        if (list==null || list.isEmpty()){
            return null;
        }
        return list.get(0);
    }
    
    @Override
    public List<GoodsList> findGoodsList(GoodsList goodsList) {
        return goodsListDao.findGoodsList(goodsList);
    }

    @Override
    public List<GoodListDto> findProductGoodsList(GoodsList goodsList) {
        return goodsListDao.findProductGoodsList(goodsList);
    }

}
